package com.voda.web.jackson;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.hibernate3.Hibernate3Module;

/**
 * The Class HibernateAwareObjectMapper.
 */
public class HibernateAwareObjectMapper extends ObjectMapper{
	 
 	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -5806420240168104981L;

	/**
	 * Instantiates a new hibernate aware object mapper.
	 */
	public HibernateAwareObjectMapper() {
	    Hibernate3Module hm = new Hibernate3Module();
	    hm.disable(Hibernate3Module.Feature.FORCE_LAZY_LOADING);
	    enable(SerializationFeature.INDENT_OUTPUT);
	    enable(SerializationFeature.WRAP_EXCEPTIONS);
	    registerModule(hm);
	}
}
